<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    *{
      margin: 0;
      padding: 0;
    }
    .container{
      width: 1200px;
      margin: 0 auto;
      background-color: red;
    }
    .box{
      box-sizing: border-box; /*盒模型设置为怪异盒模型（IE）盒模型*/
      /* margin: 0 10px; */
      padding: 5px;
      display: inline-block;  /*天坑*/
      width: 50%;
      height: 100px;
      background-color: green;
    }
    .box:nth-child(2){
      background-color: yellow;
    }
  </style>
</head>
<body>
  <div class="container">
    <div class="box">1</div><div class="box">2</div>
  </div>
</body>
</html>